Windows Firewall is included with Windows
from SP2 onwards and can be manipulated programmatically using DarkNet.
When adding a firewall entry e.g. mnAddApplication,
the application may be rejected if any parameters are invalid. The error
message may not make this clear, so you should assume that any failure
while using such commands means that a parameter is invalid.
In C++ you can use the following constants:
Profile type
- FW_DOMAIN = 2
- FW_STANDARD = 1
IP version
- FW_IP_V4 = 0
- FW_IP_V6 = 1
- FW_IP_ANY = 2
Protocol
- FW_UDP = 17
- FW_TCP = 6
Service type
- FW_FILE_PRINT = 0
- FW_UPNP = 1
- FW_REMOTE_DESKTOP = 2
- FW_NONE = 3
Scope
- FW_SCOPE_ALL = 0
- FW_SCOPE_LOCAL_SUBNET = 1
- FW_SCOPE_CUSTOM = 2
1: Firewall General